{
    class Tu {
        constructor() {
            this.Li = document.querySelector('.main .body')
            this.On = document.querySelectorAll('.main .body .xuan .in input')
            this.Hhui = document.querySelector('.huid')
            // this.Zu = document.querySelector('')
            this.Biao()
            this.Hding()
            // this.Xuan()
            this.Shai()

        }
        Biao() {
            let xhr = new XMLHttpRequest()
            xhr.open('get', 'http://192.168.10.28:8080/qfDownload/selectAll', true)
            xhr.send()
            xhr.onload = () => {
                let json = JSON.parse(xhr.responseText)
                console.log(json)
                // console.log(this.Li)
                // console.log(this.On)
                json.data.forEach(ele => {
                    this.Li.innerHTML += `
                    <div class="bod">
                    <li class="header">
                    <div></div>
                    <div>
                        <span>${ele.dname}</span>
                    </div>
                    <div>
                        <span>${ele.categoryname}</span>
                    </div>
                    <div>
                        <span>${ele.filesize}</span>
                    </div>
                    
                </li>
                <div>
                     <a en="${ele.id}" class="ele"  herf="http://192.168.10.28:8080/${ele.ddesc}" download="">
                    <svg class="icon" style="width: 1em;height: 1em;vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5401"><path d="M840.5 900.3h-657c-16.5 0-29.9 13.4-29.9 29.9s13.4 29.9 29.9 29.9h657.1c16.5 0 29.9-13.4 29.9-29.9-0.1-16.6-13.5-29.9-30-29.9zM631.5 123.7V541.8H763.1L512 769.9l-251.2-228h131.7V123.7h239m0-59.7h-239c-33 0-59.7 26.7-59.7 59.7v358.4H183.5c-26.6 0-39.9 32.2-21.1 51l328.5 298.2c5.8 5.8 13.5 8.7 21.1 8.7s15.3-2.9 21.1-8.7l328.5-298.2c18.8-18.8 5.5-51-21.1-51H691.2V123.7c0-33-26.7-59.7-59.7-59.7z" p-id="5402"></path></svg>
                  <span>下载</span>
                  
                </a>

                </div>
                </div>
                `
                // this.Xuan()

                    // this.Li.children[0].setAttribute('class','bod')
                })
            }
            // this.Xuan()
        }

        Hding() {
            // this.Hhui
            let timer = 0
            // console.log(document.documentElement.scrollTop)
            setInterval(() => {
                if (document.documentElement.scrollTop < 100) {
                    this.Hhui.style.display = 'none'
                } else {
                    this.Hhui.style.display = 'block'
                }
            }, 1)

            document.documentElement.scrollTop
            this.Hhui.onclick = () => {
                clearInterval(timer)
                // document.documentElement.scrollTop = 0
                timer = setInterval(() => {
                    document.documentElement.scrollTop -= 130
                }, 100)
                if (document.documentElement.scrollTop === 0) {
                    clearInterval(timer)
                }
            }
            document.onmousewheel = () => {
                clearInterval(timer)
            }
        }

        Shai() {
            this.Li.onclick = function (ele) {
                if (ele.target.className == 'ele') {
                    let id = ele.target.getAttribute('en')
                    console.log(id)
                }
            }
        }
        Fenz() {

        }
    }
    new Tu()
}
